﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Threading;

namespace SetDisplayFrequencyArgs
{
    class Program
    {
        ////// The DisplayFrequency to set
        ////private static int hz = 50;

        static void Main(string[] args)
        {
            if (args.Length != 1 || !args[0].StartsWith("/") || args[0].Length != 3)
            {
                ShowUsage();
                return;
            }

            int hz = -1;
            int.TryParse(args[0].Substring(1, 2), out hz);

            if (hz == 24 || hz == 50 || hz == 60)
            {
                Shared.SetFrequence(hz);
            }
            else
            {
                ShowUsage();
            }
        }

        private static void ShowUsage()
        {
            Console.WriteLine("Usage: SetDisplayFrequency.exe /hz");
            Console.WriteLine("where hz can be 24, 50 or 60");
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Press Enter to exit."); 
            Console.ReadLine();
        }

    }
}
